package xin.yangshuai.leetcode01;

/**
 * Student
 *
 * @author shuai
 * @date 2021/6/25
 */
public class Student {

    private String name;

    private int score;

    // 无参
    public Student() {
    }

    // 2参
    public Student(String name, int score) {
        this.name = name;
        this.score = score;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getScore() {
        return score;
    }

    public void setScore(int score) {
        this.score = score;
    }

    @Override
    public String toString() {
        return "Student{" +
                "name='" + name + '\'' +
                ", score=" + score +
                '}';
    }

    public static void main(String[] args) {
        //无参创建对象
        Student student = new Student();
        student.setName("zhangsan");
        student.setScore(100);
        System.out.println(student);

        // 有参创建对象
        Student student1 = new Student("lisi", 98);
        System.out.println(student1);

    }
}
